var express = require('express');
var router = express.Router();
var pool = require('../config/mysqlconfig');
// http://localhost:3000/art/all
router.get('/all',function(req,res,next){
    pool.getConnection(function(err,conn){
        if(err){
            console.log("数据库连接失败")
        }else{
            var sql = "select * from article"
            conn.query(sql,function(error,results){
                if(error){
                    console.log("查询失败")
                }
                res.send(results)
                conn.release()
            })
        }
    })
})

module.exports = router;